<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户中心</title>
</head>


<script src="<?php echo $_BASE_DIR?>javascripts/jquery.min.js"
	type="text/javascript"></script>
<script type="text/javascript">
function set(acctname,sipcode,num)
{
	$.get('<?php echo url("admin::cbquick/set")?>',{acctname: acctname, sipcode: sipcode, num: num },function(data){alert(data);});
	}
</script>
<?php 
	$acctuser = Acctuser::find('acctname = ?',$_SESSION['acct']['acctname'])->getOne();

?>
<body>
欢迎回来:<?php echo $_SESSION['acct']['acctname']?>,您当前余额:<?php echo $acctuser->balance;?>
<hr>
<table class="table" width="600" >
		<thead>
			<tr>
				<th width="5%" orderField="acctname" >序号</th>
				<th width="5%" >亲情号码</th>
				<th width="3%" orderField="enable">我的绑定</th>
				
				
			</tr>
		</thead>
		<tbody>
		<?php 
			$acctname = $_SESSION['acct']['acclevel'] == 3 ? $_SESSION['acct']['acctname'] : ($_REQUEST['acctname']); 
			
			?>
			<?php foreach ($data as $k=>$v):?>
			<tr target="id">
				
				<td><?php echo $v->sipcode?></td>
				<td><?php echo $v->sipnum;?> </td>
				<?php 
					$usernum = Cbbind::find('acctname = ? and sipnum=?',$acctname,$v->sipcode)->getOne();
					
					$num = $usernum->bindnum ? $usernum->bindnum : '';
				?>
				<td><input type="text" size="12" name="num_<?php echo $v->sipcode;?>" value="<?php echo $num;?>" id="num_<?php echo $v->sipcode;?>"  /> <input type="button" value="修改" onclick="set('<?php echo $acctname;?>','<?php echo $v->sipnum?>',$('#num_<?php echo $v->sipcode;?>').val());" /></td>
				
			</tr>
			<?php endforeach;?>
		</tbody>
	</table>

</body></html>